import axios from 'axios'
import { Message } from 'element-ui'

axios.interceptors.request.use((config) => {
    const token = sessionStorage.getItem('token')? sessionStorage.getItem('token'): ''
    config.headers.Authorization = token
    return config
})

axios.interceptors.response.use((data) => {
    Message.success(data.data.msg)
    return data
})

export default axios